import request from '@/utils/request'
// 获取公司部门列表的接口
export const reqGetDepartments = () => {
  return request({
    method: 'GET',
    url: '/company/department'
  })
}
/**
 * 根据id删除部门
 * **/
export function reqDelDepartments(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}
//  添加部门
export function reqAddDepartments(data) {
  return request({
    method: 'POST',
    url: '/company/department',
    data
  })
}
// 根据部门id查询部门详情
export function reqGetDepartmentDetail(id) {
  return request({
    method: 'GET',
    url: `/company/department/${id}`
  })
}
// 编辑部门提交
export function reqEditDepart(data) {
  return request({
    method: 'PUT',
    url: `/company/department/${data.id}`,
    data
  })
}
